<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/WEB-INF/template/globalTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:opif="http://www.opif.com/formathlon/jsf/tags">

    
    <f:metadata>
        <f:viewParam name="session" converter="#{sessionConverter}" value="#{userEmargementBean.session}" />
    </f:metadata>
    
    
    <ui:define name="title">#{msg['application.titre.utilisateur.emargement']}</ui:define>


    <ui:define name="ariane">
        <h:commandLink action="/faces/index.xhtml"  
                       value="#{msg['application.titre.accueil']}"/>
        > <h:commandLink action="/faces/pages/user/session/gerer_session.xhtml?faces-redirect=true"
                       value="#{msg['application.titre.utilisateur.session']}"/>
        >
        #{msg['application.titre.utilisateur.emargement']}
    </ui:define>
    
    
    <ui:define name="content">
        <h:panelGroup rendered="#{userEmargementBean.canEmarger()}">
            <h:panelGroup styleClass="titre">Feuille d'émargement</h:panelGroup>
            <p:dataTable value="#{userEmargementBean.listParticipationGlobale}"
                         var="participationGlobale" emptyMessage="#{msg['application.emptyMessage']}"
                         style="width:400px">
                <p:column headerText="Personne">
                    <h:outputText value="#{participationGlobale.inscription.personnel}"/>
                </p:column>
                <p:column headerText="Participation">
                    <p:selectBooleanCheckbox value="#{participationGlobale.participe}" />
                </p:column>
            </p:dataTable>
            <p:commandButton action="#{userEmargementBean.valider()}"
                             ajax="false"  
                             update="messages"
                             value="Valider les présences et archiver la session"/>
        </h:panelGroup>
    </ui:define>

    

</ui:composition>
